package cn.ecut.demo04;

import cn.ecut.demo02.UserService;
import cn.ecut.demo02.UserServiceImpl;

/**
 * @Author ruanxin
 */
public class Client {
    public static void main(String[] args) {
        //真实对象
        UserServiceImpl userService = new UserServiceImpl();
        //代理角色，不存在
        ProxyInvocationHandler pih = new ProxyInvocationHandler();

        pih.setRent(userService);
        UserService proxy = (UserService) pih.getProxy();
        proxy.delete();
    }
}
